<?php
	require_once("../inc/models/products_model.php");
	if(isset($_POST['submit']))
	{
		$row = $_POST;
		NewProduct($row);
		header("Location: index.php");
	}
	else
	{
		$product = GetProductKeywords();	
	}
?>
<!DOCTYPE html>
<html lang="en">
        <?php include('../inc/header.php'); ?>
        <body>
        <?php include('../inc/navigation.php'); ?>
        <div class="span9">
        	<div class="row-fluid">
	        	<h2>Create new Product</h2>        
	        	<form class="well" method="post" action="#">
					<div class=" control-group">
	                	<label class="control-label" for="product_category">Product Category:</label>
	                    <div class="controls">
	                     	<select name="product_category" id = "product_category">
	                       		<? while($rs = $product->fetch_assoc()): ?>
	                       			<option value="<?=$rs['id']?>"><?=$rs['Value']?></option>
	                       		<?php endwhile; ?>                        		                    		
	                       	</select>                        	                            	
	                    </div>
	               </div>   
	               <div class=" control-group">
	               	<label class="control-label" for="name">Product Name:</label>
	                	<div class="controls">                        	
							<input type="text" name="product_name" id="product_name"/>
						</div>
					</div>                   
					<div class=" control-group">
	                	<label class="control-label" for="price">Price:</label>
	                    <div class="controls">                        	
							<input type="text" name="price" id="price"/>
						</div>
					</div>  
					<div class=" control-group">
	                	<label class="control-label" for="weight">Weight(in pounds):</label>
	                    <div class="controls">                        	
							<input type="text" name="weight" id="weight"/>
						</div>
					</div> 
					<div class=" control-group">
	                	<label class="control-label" for="stock">Stock:</label>
	                    <div class="controls">                        	
							<input type="text" name="stock" id="stock"/>
						</div>
					</div>                         
					<input type="submit" name="submit" value="Submit" />
				</form>
			</div>
        </div>
        <!-- All Bootstrap JavaScript Files -->
       <script src="../inc/bootstrap/js/jquery.js"></script>
       <script src="../inc/bootstrap/js/bootstrap.js"></script>
   </body>
</html>